import useMicroStore from '@apps/_share/store/micro'

const { $t } = useMicroStore()

export const schemas = [
  {
    // title: $t('用户名'),
    titleSlot: 'user-title',
    field: 'test',
    column: 1,
    component: {
      vm: 'el-input',
      value: '',
      props: {
        clearable: true,
        placeholder: $t('请输入'),
      },
    },
  },
  {
    title: $t('部门'),
    iconSlot: 'status-icon',
    field: 'status',
    column: 1,
    component: {
      vm: 'BaseSelect',
      value: '',
      props: {
        options: [],
        multiple: true,
        placeholders: $t('全部'),
      },
      listeners: {
        change(v: string) {
          console.log('change>>>>', v)
        },
      },
    },
  },
  {
    title: $t('角色'),
    field: 'status',
    column: 1,
    component: {
      vm: 'BaseSelect',
      value: '',
      props: {
        options: [],
        multiple: true,
        placeholders: $t('全部'),
      },
      listeners: {
        change(v: string) {
          console.log('change>>>>', v)
        },
      },
    },
  },
  {
    title: $t('状态'),
    field: 'status',
    column: 1,
    component: {
      vm: 'BaseSelect',
      value: '',
      props: {
        options: [],
        multiple: true,
        placeholders: $t('全部'),
      },
      listeners: {
        change(v: string) {
          console.log('change>>>>', v)
        },
      },
    },
  },
  {
    title: $t('创建时间'),
    field: 'times',
    column: 2,
    component: {
      vm: 'el-date-picker',
      value: [],
      props: {
        type: 'datetimerange',
        startPlaceholder: '开始时间',
        endPlaceholder: '结束时间',
      },
    },
  },
]

export const columns = [
  {
    type: 'selection',
    align: 'center',
    width: 30,
  },
  {
    prop: 'projectName',
    label: $t('用户名'),
    align: 'center',
    minWidth: 150,
  },
  {
    prop: 'projectCode',
    label: $t('工号'),
    align: 'center',
    minWidth: 150,
  },
  {
    prop: 'statusName',
    label: $t('状态'),
    align: 'center',
    minWidth: 90,
  },
  {
    prop: 'createName',
    label: $t('创建人'),
    align: 'center',
    minWidth: 120,
  },
  {
    prop: 'createTime',
    label: $t('创建时间'),
    align: 'center',
    minWidth: 190,
  },
  {
    prop: 'modifyName',
    label: $t('修改人'),
    align: 'center',
    minWidth: 120,
  },
  {
    prop: 'modifyTime',
    label: $t('修改时间'),
    align: 'center',
    minWidth: 190,
  },
  {
    label: $t('操作'),
    slot: 'operation',
    align: 'center',
    fixed: 'right',
    minWidth: 170,
  },
]
